package com.gpstracking.GData;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;

import com.gpstracking.Utils.Geometry.Point;



public class GArea {
	public ArrayList<Point> points;

	public static List<Point> getPoints(String json) {
		double [] raw_points = new Gson().fromJson(json, double[].class);
		
		java.util.List<Point> res = new ArrayList<Point>();
		
		for( int i = 0; i < raw_points.length; i += 2){
			double x = raw_points[ i ];
			double y = raw_points[ i + 1 ];
			
			res.add( new Point( x , y ));
			
		}
		
		return res;
	} 
}
